Skip to main content

Posts

Showing posts from May, 2016

How to add content editor web part to webpart gallery| Export content editor web part (OOTB in SharePoint)

By default content editor web part is not exporting as *.webpart file as other out-of-the-box(OOTB) web parts, it is exported as *.dwp. Basically dwp file is an element XML file which contains configurations as below;

[code language="xml"]<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2">
<Title>Content Editor</Title>
<FrameType>Default</FrameType>
...
</WebPart>
[/code]

But if you exported other web part you can be able to to extract it by converting it to *.cab file. It's not required here and you can open it by text editor simply.

Most of the people finding around exporting this since they required to include that in a VisualStudio solution. Following steps can be followed to arrive at that and if you required to add that in a site page, …

What | Why| How Angular JS

perfect for Single Page Applications (SPA)
AngularJS version 1.0 was released in 2012.Miško Hevery, a Google employee, started to work with AngularJS in 2009 and currently maintains by Google
It supports client side MVC (Model-View-Controller) and MVVM (Model-View-ViewModel) which commonly used in rich internet applications
Angular act as a front end for MEAN framework(http://meanjs.org/)
Currently stable version is 1.5 and version 2 is in beta.

Why?

unit testable
Maintainable
reusable and easy dependency injection

Why not?

need to implement authentication and authorization separately, else not safe
browser disables javascript means no angular

How to?
Angular can be used as a client side implementation for many modern systems where you can consume resources as services (XMLHttpRequest). As an example you can integrate with SharePoint, ASP.NET Web API, ASP.NET MVC and etc.
Include angular scripts to your application with link to CDN or by resolving scripts by using package manager.


[code language=&qu…

How, what and Why| X-RequestDigest (FormDigestValue) header value in SharePoint?

This value is get in to play mostly when we do POST, PUT, MERGE and DELETE requests via the SharePoint REST API. Unless you match with server digest value you won’t be able to perform the REST requests and it gives security validation issues (mostly 403 forbidden status).
How to get this value?

Send a POST request to below end point it will return the form digest value between “FormDigestValue”

http://<Site URL>/_api/contextinfo



What is X Request Digest (Form Digest Value)?

If you are not entitled to SharePoint using OAuth, your will require this value to authorize your request.

For more information:https://msdn.microsoft.com/en-us/library/office/fp142384.aspx

If you’re creating SharePoint hosted Add-in, you can take the digest value as below with JQuery

Using JQuery

[code lang="javascript" light="true"]
$("#__REQUESTDIGEST").val();
[/code]

Using Angular JS

[gist https://gist.github.com/kushanlahiruperera/3c9eb56ce7967177191cb36d8571d8c1 /]

Sample Digest value :
0…

#SPTechInspirit #1 What | Why SharePoint

As first post on this series, though of starting from the elementary basics which are what and why. Briefly post will be focusing on below;
What is SharePoint?

Why SharePoint?

Why need SharePoint rather than moving to developing from the scratch approach? 
SharePoint is a platform for developers and professionals where mostly focuses on business content.

SharePoint serve as a platform you to design and develop business solutions.

Currently SharePoint available as both On-promise (Host SharePoint locally) and subscription based service (Office 365)

Main advantage if you moved to develop with SharePoint is its OOTB (Out of The Box) features it contains. As a example, if you develop with other development model you may need to develop and concentrate on authentication, administration, deployment, maintenance and etc. But In the SharePoint it ready made, you need to concentrate on those minimally.

SharePoint History | Versions

Microsoft have released six versions of SharePoint (On Premise) with differentiated enhancements and features.



Year
Core infastructure
SharePoint Version


2001
SharePoint Team Services
SharePoint Portal Server 2001


2003
Windows SharePoint Services 2.0
Microsoft SharePoint Portal Server 2003


2007
Windows SharePoint Services 3.0
Microsoft Office SharePoint Server 2007


2010
Microsoft SharePoint Foundation 2010
Microsoft SharePoint Server 2010


2013
Microsoft SharePoint Foundation 2013
Microsoft SharePoint Server 2013


2016
Not distribute separately and compatible with Foundation 2013
Microsoft SharePoint Server 2016



SharePoint 2001 was the first version which only capable of perform data driven actions such as sites, list, document libraries. This was build on top of SQL Server database.

SharePoint 2003 was first version which built on .NET framework and ASP.NET and first which enabled developers to developers add custom solutions.

SharePoint 2007 introduced site columns, content types, features, master pages, use…

File attach (POST) to SharePoint 2013 List (custom) using Angular JS via REST API

Following describes how to upload attachment to SharePoint 2013 custom list using Angular JS.

Note: You can be consumed the JSOM libraries to achieve this, but there is limitation of 1.5 Mb. Better approach would be consuming exposed REST API (SharePoint OOTB) which allowed up to 2 Gb of file to attached using client side scripts i.e. Angular JS. .





Here I have used the “Angular File Upload” which capable of doing more tasks other than basic HTML input file control. By consuming this we can attach multiple files either to the list and etc. You can be found the information on how to include this module to your Angular view in following link.

Use package manager command to install the scripts.
For bower  -->        bower install angular-file-upload

For nugget -->       npm install angular-file-upload
It requires file buffer array to POST (save) our attachment via REST API, browsers FileReader API is required to use. Its available with almost all common browsers. You need to ensure that i…