Tuesday, April 10, 2018

How to install Sitecore Experience Accelerator (SXA)


In this article, I will explain how to install Sitecore Experience Accelerator (SXA). To install the SXA
pre-requisite are: 
  • Siteocre installation
  • Sitecore license with SXA : Go to Control Panel > ADMINISTRATION > Installed licenses 



 SXA license details

After Sitecore installation and verifying the SXA license, now install the SXA. For this first verify  Sitecore Experience Accelerator compatibility table at https://kb.sitecore.net/articles/180187.


>Install the Sitecore PowerShell Extensions: Go Launchpad->Control Panel->Install a package > Select downloaded Sitecore PowerShell Extensions 
Select the package
>Install the Sitecore Experience Accelerator: Go Launchpad->Control Panel->Install a package > Select downloaded Sitecore Experience Accelerator

After successful installation of SXA, right click on Content item in Sitecore Content Tree > Click on Insert item > you will find Tenant/Tenant Folder item for insertion: 
Sitecore SXA installation - Tenant/Tenant Folder
Share:

Sunday, April 08, 2018

What is Sitecore Experience Accelerator (SXA)


Lots of articles present on internet about Sitecore Experience Accelerator (SXA), but with this article I am going to explain about my experience with SXA. 

Before proceeding into my experience about Sitecore Experience Accelerator (SXA), let me provide you brief overview of Sitecore Experience Accelerator (SXA). 

Sitecore Experience Accelerator (SXA): Will provide the facility to use out-of-the-box component library, drag n drop facility of component with properties, based on HELIX architecture, easy to work with UI team (Creative Exchange functionality), provide grid’s like Bootstrap/Foundation/Grid 960 (render columns for RWD), increase productivity, SXA implies best practices and many more..

SXA separates structure from design, so front-end designers, creative designers, content authors, and developers can work in parallel and you can deploy and maintain multiple sites quickly and cost effectively. 


Image from: Sitecore.net

The following graphical overview lists the platform elements and how they are integrated.


Image from: Sitecore.net

My experience with Sitecore Experience Accelerator (SXA) as developer was very good. It helps: 
  • Provides most of the components out-of-the-box (OOTB) which required to build-up basic Website. 
  • Provides in-build functionality to support Multi –Tenant/Multi-Site approach. 
  • No need to add node in SiteDefinition.config for new site, it will be managed by SXA itself and provides same attributes as present in SiteDefinition.config file. 
  • Different-2 themes for each site. We can also add custom css/js and media. 
  • Restrict the access of Features/Component as per need basis. 
  • Choose between different grid systems(Bootstrap/Foundation/Grid 960).
  • Rendering variants to change the look and feel of components as per need basis and most of the Sitecore Experience Accelerator (SXA) components supports Rendering variants.
  • Support Responsive Web design. 
  • Page design/Partial design, to create the design of the page with components. 
  • Export/Import of HTML/CSS/JS/Media with restriction to modify only styling not HTML structure. 
  • Ease of use for UI team developer, after providing the overview of SXA structure (CSS/JS/Media location). 
In the upcoming articles, I will try to cover most of the features/attributes, which would be useful for development team. 
  
Reference from: 






Share:

Sunday, April 02, 2017

SPServices:Update multiple items in SharePoint List or Document Library using SPServices jQuery library in SharePoint

Update multiple items in SharePoint List or Document Library using SPServices jQuery library in SharePoint

In SharePoint 2013 we can utilize client side code to update the list item. The client side scripting includes:

  • JSOM (JavaScript Object Model)
  • REST API using JQuery AJAX call
  • SPServices JavaScript Add-on


In this article, i will explain How to use SPUpdateMultipleListItems function of SPServices JavaScript add-on to Update or Delete Multiple/Single Items.

The details of $().SPServices. SPUpdateMultipleListItems operation are:

[pre class="brush:jscript" ] $().SPServices({ webURL: {web URL}, async: {true/false}, listName: {List Name}, CAMLQuery: {caml Query}, batchCmd: {"Delete" or "Update"}, valuepairs: {key/value pair of columns}, ID: {Id of the row, when update record}, completefunc: function (xData, Status) { console.log('List items has been updated'); } }); [/pre]

  • webURL: This allows you to change the context for the operation to a different site
  • async: you can pass true or false
  • listName: Name of the list from which data needs to be fetched
  • CAMLQuery: The CAMLQuery option allows you to specify the filter on the list. CAMLQuery here should contain valid CAML such as:

         [pre class="brush:jscript" ] var camlQuery = ''; camlQuery += ''; camlQuery += "Yes; camlQuery += ''; camlQuery += ''; [/pre]
  • batchCmd: We can set value as "Delete" or "Update".
  • valuepairs: It is an optional parameter and used to define Key/Value pair. If you specify updates then valuepairs should not be specified.


valuepairs: [["Title", "Amit Kumar"], ["Technologies", ".NET, SharePoint, AngularJS"]]

  •     ID: It’s an optional parameter and needs to be used with valuepairs  when we are using the batchCmd as "Update".


Update single item the SharePoint List using $().SPServices. SPUpdateMultipleListItems operation with valuepairs option:
[pre class="brush:jscript" ] var camlQuery = ''; camlQuery += ''; camlQuery += "Yes; camlQuery += ''; camlQuery += ''; $().SPServices({ async: false, batchCmd: "Update", listName: "AmitKumar_TestList", ID: 1, valuepairs: [["Title","Amit Kumar"]], CAMLQuery: camlQuery, completefunc: function (xData, Status) { console.log('List items has been updated'); } }); [/pre]




In the above code block, we are using "Update" batchCmd with ID attribute to update single item.

Delete mulitple item the SharePoint List using $().SPServices. SPUpdateMultipleListItems operation with valuepairs option: 

[pre class="brush:jscript" ] var camlQuery = ''; camlQuery += ''; camlQuery += "Yes; camlQuery += ''; camlQuery += ''; $().SPServices({ async: false, batchCmd: "Delete", listName: "AmitKumar_TestList", CAMLQuery: camlQuery, completefunc: function (xData, Status) { console.log('List items has been updated'); } }); [/pre]

In the above code block, we are using "Delete" batchCmd with CAMLQuery attribute to delete multiple items.

The SPUpdateMultipleListItems function works like this:

It first calls GetListItems with the provided CAMLQuery to find all off the items which meet the criteria
Then the function calls UpdateListItems and updates all of the items found with the values provided.

Reference: https://github.com/sympmarc/SPServices/wiki/SPUpdateMultipleListItems   

Share:

Wednesday, March 29, 2017

SPServices:Delete item in SharePoint List or Document Library using SPServices jQuery library in SharePoint


Delete item in SharePoint List or Document Library using SPServices jQuery library in SharePoint

In my previous article, Update item in SharePoint List or Document Library using SPServices jQuery library in SharePoint, I already explained about $().SPServices.UpdateListItems operation to access the listing of folder.

For example, in SharePoint online site, we need to delete item in SharePoint List or Document library on the basis of key field when user click on button.

To implement above requirement, we can not use the SharePoint Server Side code, so we need to utilize the Client Side Scripting – JSOM/Call to SharePoint REST API using JQuery/Use of SPServices JQuery Library.

Now, I am going to explain how to delete item in SharePoint List or Document Library using SPServices jQuery library in SharePoint. SPServices JavaScript Library ($().SPServices) provides function called UpdateListItems to delete content in the SharePoint list.

Delete item the SharePoint Document Library or List using $().SPServices.UpdateListItems operation with batchCmd option:

[pre class="brush:jscript" ] $().SPServices({ operation: "UpdateListItems", async: false, listName: "AmitKumar_TestList", batchCmd: "Delete", ID: 3, completefunc: function(xData, Status) { console.log('List items has been deleted'); } }); [/pre]

In the above code block, we are not using updates attributes of "UpdateListItems" operation, instead using batchCmd attribute to delete row on the basis of ID.


Delete item in SharePoint List using $().SPServices.UpdateListItems operation with CAML query:

[pre class="brush:jscript" ] var id = 1; var camlQuery = '' + '' + '' + id + '' + '' + ''; var objPromise = $().SPServices({ operation: "UpdateListItems", async: false, listName: "AmitKumar_TestList", updates: camlQuery }); p.done({ // Manage success or failure here }); [/pre]

In the above code block, we are using updates attributes of "UpdateListItems" operation to delete item in SharePoint list.


Delete file in SharePoint Document Library using $().SPServices.UpdateListItems operation with CAML query:

[pre class="brush:jscript" ] var id = 1; var fileRef = "http://amitkumarmca04.blogspot.com/AmitLib/amitkumar.doc"; var camlQuery = '' + '' + '' + id + '' + '' + fileRef + '' + '' + ''; var objPromise = $().SPServices({ operation: "UpdateListItems", async: false, listName: "AmitKumar_TestList", updates: camlQuery }); p.done({ // Manage success or failure here }); [/pre]

In the above code block, we are using extra field called "FieldRef" with "ID" field to delete document from SharePoint document library.
In both cases, we are passing an update, which contains a batch. We can request multiple actions in the batch.

Delete multiple items in SharePoint list using $().SPServices.UpdateListItems operation with CAML query:

[pre class="brush:jscript" ] //--Sample of creating array of rows--::Start::------------// var objArrColumns = []; var objArrRows = []; //---First Row Details :: Start::------------// var objColumnDetails = new Object(); //--ID column details objColumnDetails.FieldName = "ID"; objColumnDetails.FieldValue = 1; objArrColumns.push(objColumnDetails); //--Add details to column array objArrRows.push(objArrColumns)//--Add details to Row array //---First Row Details :: End::------------// //---Second Row Details :: Start::------------// objArrColumns = null; objArrColumns = []; //--ID column details objColumnDetails = null; objColumnDetails = new Object(); objColumnDetails.FieldName = "ID"; objColumnDetails.FieldValue = 2; objArrColumns.push(objColumnDetails); //--Add details to column array objArrRows.push(objArrColumns)//--Add details to Row array //---Second Row Details :: End::------------// //--Sample of creating array of rows--::Start::------------// [/pre]


[pre class="brush:jscript" ] //-- Output would be //camlQuery = '12'; //--In simple way /* var camlQuery ='' + '' + '1'+ '' + '' + '2'+ '' + ''; */ function DeleteMultipleItems (){ var objPromise = $().SPServices({ operation: "UpdateListItems", async: false, listName: "AmitKumar_TestList", updates: camlQuery , }); return objPromise; } [/pre]

In the above code block, we are using batch command to perform delete action on multiple rows.


Share:

Tuesday, March 28, 2017

SPServices:Update item in SharePoint List or Document Library using SPServices jQuery library in SharePoint

In my previous article, How to create folder inside SharePoint List or Document Library using SPServices jQuery library in SharePoint, I already explained about $().SPServices.UpdateListItems operation to access the listing of folder.

For example, in SharePoint online site, we need to update item in SharePoint List or Document library on the basis of key field when user click on button.

To implement above requirement, we can not use the SharePoint Server Side code, so we need to utilize the Client Side Scripting – JSOM/Call to SharePoint REST API using JQuery/Use of SPServices JQuery Library.

Now, I am going to explain how to update item in SharePoint List or Document Library using SPServices jQuery library in SharePoint. SPServices JavaScript Library ($().SPServices) provides function called UpdateListItems to update content in the SharePoint list.
  • Update item the SharePoint Document Library or List using $().SPServices.UpdateListItems operation with valuepairs option:
       [pre class="brush:jscript" ] $().SPServices({ operation: "UpdateListItems", async: false, batchCmd: "Update", listName: "AmitKumar_TestList", ID: 1, valuepairs: [["Title","Amit Kumar"]], completefunc: function (xData, Status) { console.log('List items has been updated'); } }); [/pre]
     In the above code block, we are not using updates attributes of "UpdateListItems" operation,
    instead using valuepairs attribute to define the columns which needs to be updated on the basis of ID of element/row.
   We can define more than one columns in valuepairs attribute, it will serve as an array of columns:
valuepairs: [["Title", "Amit Kumar"], ["Technologies", ".NET, SharePoint, AngularJS"]]
  • Update item in SharePoint Document Library or List using $().SPServices.UpdateListItems operation with CAML query:
[pre class="brush:jscript" ] var camlQuery = '' + '' + 'Amit Kumar' + '.NET, SharePoint, AngularJS' + '1' + '' + ''; $().SPServices({ operation: "UpdateListItems", async: false, listName: "AmitKumar_TestList", updates: camlQuery , completefunc: function(xData, Status) { console.log('List items has been updated'); } }); [/pre]

In the above code block, we are not using batchCmd/ID attributes of "UpdateListItems" operation, instead using updates attribute to define the columns which needs to be updated based on ID of element/row. The default for the batchCmd option is 'Update'


More articles on SPServices:
What is SPServices
How to access List Data using SPServices jQuery library in SharePoint
How to access list of folder name from SharePoint List or Document Library using SPServices jQuery library in SharePoint
How to create/add folder in SharePoint List or Document Library using SPServices jQuery library in SharePoint
Update item in SharePoint List or Document Library using SPServices jQuery library in SharePoint

Share:

About Me

My photo
Based in Bangalore, INDIA, Amit is a MCC. He has an MCA from the U.P.T.U., INDIA and holds Microsoft certifications including SharePoint 2007/2010. He is an contributor to MSDN and http://amitkumarmca04.blogspot.com/. Amit have experience in SharePoint,ASP.Net with C#, MVC, Sitecore, Classic ASP, VB,Macros,HTML,JavaScript,JSON,BootStrap and AngularJS.

Followers

Labels