Thursday, November 24, 2016

Custom Sitecore Command to Disable or Hide Full Publish Menu Option in Sitecore Content Editor

Recently there was a question raised in Sitecore StackExchange site related to disable Full-Publish option in Sitecore Content Editor for all the Editors access the Content Editor, including Administrator users.

Refer original question http://sitecore.stackexchange.com/questions/2763/how-to-prevent-site-publishing-for-everyone/2766#2766




So, basically question was that hide the "Publish site" option for all the users including Sitecore Administrators, from Content Editor.

There were some good suggestion/answers and a suggestion that I didn't agree.

One option was to set permission on menu item in Core database (i.e. /sitecore/content/Applications/Content Editor/Menues/Publish) will not solve this issue since permission will not effect Administrator users.

 Another option suggested was to delete the Full publish menu item from Sitecore Core database (i.e. /sitecore/content/Applications/Content Editor/Menues/Publish). If there is no other way, this is the final option.

UPDATE:
I learned today by a Sitecore friend (Kamruz) that there is another way to achieve this. That is by using Sitecore Rules Engine. You can refer following post for more info
http://stackoverflow.com/questions/37659935/restrict-sitecore-publishing/37691414#37691414


I had a look into this and created a custom Sitecore command to provide more flexible option for this issue.

First I looked into the Sitecore code related to system:publish command which was associated with this "Site publish" menu item and adjust it to support few options which can be changed using config setting.

Basically this will provide you with a Sitecore setting which you can adjust by changing config include file, with options to

  1. Run the default sitecore publishing operation
  2. Display a warning message and ignore the publishing
  3. Hide the menu item from Content Editor

How to Configure the Custom Command

Step 1:

Copy the code dll (i.e. SitecoreFootsteps.Modules.CustomEditorFullPublishOption.dll file) into <website_root>/bin folder

Code : https://github.com/chaturangar/sitecore-footsteps/blob/master/SitecoreFootsteps.Modules/SitecoreFootsteps.Modules.CustomEditorFullPublishOption/CustomCommand/CustomFullPublish.cs

Step 2:

Place the following Config include file in your includes folder

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <commands>
      <command type="SitecoreFootsteps.Modules.CustomEditorFullPublishOption.CustomCommand.CustomFullPublish,SitecoreFootsteps.Modules.CustomEditorFullPublishOption" name="scfootsteps:customfullpublish"/>
    </commands>
    <settings>
      <!-- values : 
        enabled : works as default sitecore publishing
        disabled : display warning message and doesn't trigger publishing
        hidden : hide the full publish option
        -->
      <setting name="SitecoreFootsteps.EditorFullPublishOption" value="enabled" />
    </settings>
  </sitecore>
</configuration>


Step 3:

Adjust the publish menu item in Core database to point to newly define custom command

Open "/sitecore/content/Applications/Content Editor/Menues/Publish" item in Core database from Content Editor
Change "Message" field value to "scfootsteps:customfullpublish"




Thats it. Custom publish command is now configured and should be working.



Following are the senarios and how command behaves


Senario 1:  SitecoreFootsteps.EditorFullPublishOption setting set to "enabled"

This will work as Default Sitecore full-publish option




Senario 2: SitecoreFootsteps.EditorFullPublishOption setting set to "disabled"

This will display a warning message and skip the full-publish when "Site publish" menu item is clicked




Senario 3: SitecoreFootsteps.EditorFullPublishOption setting is set to "hidden"

This will hide the "Site publish" option from Content Editor menu




You can find the code shared in my github repository :
https://github.com/chaturangar/sitecore-footsteps/tree/master/SitecoreFootsteps.Modules/SitecoreFootsteps.Modules.CustomEditorFullPublishOption

Happy Sitecore!!

Tuesday, November 15, 2016

How to Add Items into a Queue and Package them Together

Recently, one of my previous colleagues told me that he is planning to create a module which can be used to stack-up items in to a list and later create a package from those listed/added items.

But, I remember one of the features showed by Michael West and Adam Najmanowicz in "Sitecore Powershell Extension Workshop" at Sitecore Symposium. That was the possibility first add Sitecore items into a list and later create a Sitecore Package using that list.

The same functionality that my colleague was thinking about.


So,  following is that functionality that you can see in Sitecore Powershell Extension module.


I have Sitecore 8 instance with Sitecore PowerShell Extension 4.2 module (https://marketplace.sitecore.net/en/Modules/Sitecore_PowerShell_console.aspx) installed.


Now when I right-click on an Sitecore Item, in "Scripts" -> "Packaging" menu, you can see, "Start New Package" menu item (refer below image).




Then, when I right-click on any other Sitecore Item, it will provide "Add Item to Package" option. This option will allow you to add new items to the above created package.




And if you wish to create a new package, ignoring the previous created package, then you can select "Start New Package" option in the menu.
Please note that, this will dump your previous created package and the items added to it from memory and will create a new Package fresh.


When you are done with selecting items into package, you can click "Download Package" option in the menu. It will provide you with the Sitecore Package information dialog box.


and once submitted create and allow you to download the package




Other than those options, Sitecore Powershell Extension comes with other useful functionalities.

"Add Tree to Package" - will add the full sub-tree underneath the selected item into package
"Quick Download Tree as Package" - will directly download selected item and its sub-items as an sitecore package (Note that this option will not consider any Packages you have started. It just works on currently selected item and its sub-items)

It will turn out to be a very useful feature in your day-today Sitecore work and surely will save some time.

November Meetup - 2016 - Sitecore User Group Sri Lanka

Its time for another Sitecore Meetup in Sri Lanka. "November Meetup - 2016"

This time, we are going to focus more on the basics of .NET development and UI/UX development. Though these topics are not directly related with Sitecore, those are great knowledge to have for any Sitecore developer.




Our presenters for this meetup is Pasan Samarakoon and Lakshman Palitha.

In the first session, Pasan will talk about new ASP.NET Core framework. Pasan is a Microsoft Certifield Developer with over 5 years of .NET development experience and currently works as a Senior Software Engineer (Sitecore) at Codehouse Ltd, one of the Sitecore Partners in Sri Lanka.

In the second session, Lakshman will talk about UI and UX development. Lakshman is a web developer with over 6 years of web design and development experience. He currently works as a Senior UI Developer at Codehouse Ltd.


Meetup Link : https://www.meetup.com/sugsrilanka/events/235421992/
Facebook Event : https://www.facebook.com/events/1690177041298296/


Saturday, October 1, 2016

Sitecore Latest Release - Sitecore 8.2 - Sitecore User Group Sri Lanka

For the September Meetup of Sitecore User Group Sri Lanka (SUGSL), I did a presentation about the Sitecore latest release, which is Sitecore 8.2



This release was highly anticipated and includes lot of major improvements to existing tools and progrmming methodologies used as well as newly added tools.

You can find the Slides of the presentation below.




My First Experience with Sitecore Express Migration Tool with Sitecore 8.2

With the release of Sitecore 8.2 version, a new tool was also release. It is "Sitecore Express Migration Tool". As the name suggests, it facilitates upgrade of Sitecore versions.

Since this is new, I thought of give it a go.. with very basic installations..


Initial Websites
Source : Sitecore 7.2 rev. 151021 with Launch Sitecore Installe
Target: Sitecore 8.2 rev. 160729

Sitecore Express Migration Download and Documentation
https://dev.sitecore.net/Downloads/Express_Migration_Tool/10/Express_Migration_Tool_10_Initial_Release.aspx


Steps


Step 1: Specifying input parameters




Step 2 : Selecting which content to be migrated






Step 3 : Analyzing



Step 4 : Comparison results and Provide which items/files should be migrated


Step 5 : Migration & Summary



























Nothing fancy.. just a walk-through of the steps off course...

Saturday, August 27, 2016

Learning Resources - Sitecore Mobile SDK for Xamarin

Recently I was searching for more learning materials on Sitecore Mobile SDK for Xamarin and was able to found lot of information which I have not come across earlier..

So, I thought I will share those links with you, in case someone find it useful..


Mobile SDK Source and Nuget packages


Sitecore Mobile SDK for Xamarin - Xamarin Website
https://components.xamarin.com/gettingstarted/sitecore.mobile.sdk - Xamarin Website

https://github.com/Sitecore/sitecore-xamarin-pcl-sdk - Sitecore


dev.sitecore.net

https://dev.sitecore.net/Downloads/Sitecore_Mobile_SDK_for_Xamarin/1_0/Sitecore_Mobile_SDK_10_for_Xamarin.aspx


doc.sitecore.net


https://doc.sitecore.net/mobile_sdk_for_xamarin/managing_content_with_the_mobile_sdk


Advance Blog series by Sitecore MVP Goran




Blogs by Sitecore MVP Chaturanga (Me - SitecoreFootstep :-D )




Friday, August 19, 2016

SUGCON-EUROPE 2016 by Sitecore Footsteps Eye

I recently participated for Sitecore User Group Conference Europe 2016 which was held in Copenhagen, Denmark. 

It was a great event with lot of knolwedge shared and great Sitecore community participation.

I traveled from Colombo, Sri Lanka and reach Copenhagen on Saturday (23rd April).

On Sunday, met lot of Sitecore Commuinty experts/MVPs/friends and had a boat ride to see Copenhagen.


Event started Monday (25th April) with lot of Sitecore community participating not only from the Europe, but globally.




Unicorn by Kam Figy

Sitecore MVP Awards




Met an Old Friend - Jon Kasimir from IFS

Sitecore MVP Awards Ceramony


Sitecore Marketing Summit - Copenhagen

Awards for SUGCON-EU Organisers by Pieter

Sitecore Technology MVP 2016 Award

All the Presents & Memories from SUGCON-EU 2016


The End !