Sunday, March 26, 2017

Schedule Publish/UnPublish Best practices


Publishing best practices
Schedule Publishing/UnPublishing
Architecture and customization
-Jitendara Soni




1 Introduction

For scheduling and unpublished content based on the upcoming dates is a key area for the Architecture to take the right decision, even to agree for the initial discussion,
Here, it’s an attempt to cover – What is default is Sitecore and what all are the must required changes/customization.
Example – Scheduling.




2 Schedule publishing and unpublishing – Best Practices.


Schedule publishing and unpublishing scenarios.

Scneaion after enabling the future publishing job, as example below

3.1 Scenario 1 – Create an item without any worklow.

Item will be published.

3.2 Scenario 1.1 – Create second version of that item without any workflow

Second item will automatically published.

3.3 Scenario 1.1 – never publish setup without any workflow.

Set never publish to this items – let see if this item automatically disappear or not
It would be quickly deleted.

3.4 Scenario 2.1 – Create item with workflow

It will be published after approval

3.5 Scenario 2.2 – Create new version of workflow items

After approval for next 5 minutes, previous content will be moved.

3.6 Scenario 2.3 – Schdule multiple item through publish menu-change options

Here multiple item can be defined, below are the details


Pipeline Execution:-

Note :-  For any execution and logic for the pipeline execution below information will be usefull.

We wanted to process some date modification on pipeline and used itemCompleted pipeline but that will only triggered once for all language versions, then have to move our code to itemProcessing pipelines.

Details:-

ItemProcessing - this will be executed for all language versions. Let's say if you have one content for five languages then it will be executed for five time, You code should handle to be executed for one or multiple time based on your field type Shared or not.

Pipeline processing End :- This will be executetd only one time, let's say if you have content published for five languages it will be executed once.

Piple line end: this will also be executed once as Pipeline process End





Tuesday, March 14, 2017

Sitecore:- How to exclude particualr .DLL from the TDS package.

From my previous blog
http://jitendrasoni.blogspot.co.uk/2015/01/sitecore-how-to-exclude-particualr-dll.html



Hi folks,

Today, We got different scenario where our client was expecting the TDS package but that should not have some common.dll.

Problem :- If we create the solution without that dll then it will not be build.

Solutions :-

TDS has a feature to exclude the respective dll's

Sitecore Experiences -Unlock Items

Contents

1   Introduction

This utility will provide option to unlock any item, in such cases items get locked by other editorial team and may need to work by other team, they can use this utility to unlock this item.


Message will looks like




1.1  Purpose of document

Provide the facility and custom menu option to editor to unlock any items. This will create new version in the system for the auditing purpose.

2   Sitecore Customization

2.1     Unlock Item Functionality.


In this customization, there would be a new Menu in the ribbon bar, If Unlock item will be clicked, Current locked item will be unlocked.

2.2     Unlock Item Functionality – How to implement/Extend.

Unlock item if that locked by someone else.

2.2.1              Create Ribbon- Login and go to Core DB window.

 




2.2.2              Add new Ribbon Item from Reference Template.

 Go to path: - /sitecore/content/Applications/Content Editor/Ribbons/Ribbons
Right click and define new ribbon


Select Template
Template Path: - /sitecore/templates/System/Reference -


2.2.3 Add reference items/Ribbon-Strips



Path for template:- /sitecore/templates/System/Ribbon/Strip


Add reference item:-

2.2.2 Define Chunk Item and add reference

Template path: - /sitecore/templates/System/Ribbon/Chunk

2.2.5              Add Button to Ribbon

Path: - /sitecore/templates/System/Ribbon/Large Button

Add chunk button reference to strip

Add strip referent to ribbon

2.2.6              Define command for button and configuration

2.2.7              Finally, add this new ribbon to Master/Editorial Window



2.2.8             Sample Configuration and code file





Sample Code for configuration of command file"-


using System;
using Sitecore;
using Siteco.reDiagnostics;
using Sitecore.Shell.Framework.Commands;

namespace sf.web.Custom.UnLock
{
    public class UnLock : Comma
nd

 
{
 

      public override void Execute(CommandContext context)
        {
            try
            {
                var item = context.Items[0];
                if (item == null) return;
                    item.Editing.BeginEdit();
                    item.Locking.Unlock();
                    item.Editing.EndEdit();
                    Context.ClientPage.SendMessage(this, "item:checkedin");
                    Context.ClientPage.ClientResponse.Alert(item.Name + " has been Checkin completed!");
            }
            catch (Exception ex)
            {
             Context.ClientPage.ClientResponse.Alert("error in checkein completed!");
             Log.Error("Unlock - Error occured"  , ex);
            }
        }  
    }
}

Ref document :-