Cirrus Application
1. Created custom field in Sitecore
Step 1: First we need to create the field in Core database. I have created Multilist field. We have to create the field in below Path
/sitecore/system/Field types/List Types/
Step 2 : We have to create config file to initialize the custom field. We have to specify the Namespace, AssessmblyName and Prefix.
Step 3 : We have to create class file to write the logic for updating DataSource for the custom field. In the logic StartSearchLocation will be replaced as current site which is parent of current item.
Path of the class file : Cirrus.Foundation.SitecoreExtensions.CustomFields.CustomMulltiListSearchField
Step 4 : Need to set the DataSource value for our custom field.
DataSource is nothing but when we creating the filed with custom field type, where we have to specify the DataSource for the multilist field.
StartSearchLocation=$sitenode&TemplateFilter={38190DCB-F949-4793-A664-6C7EEA33730A}|{06F76AAE-1054-4221-A92E-B9C821482784}|{3CE0849F-D058-4F61-ACE7-44F33874791C}
2. Implemented Sitecore Commands
We have customized sitecore ribbon in core database. Where we have to create Reference, Strips and Chunks. For detailed reference, the below link covers.
https://cmsview.wordpress.com/2015/03/17/sitecore-8-for-beginners-adding-custom-button-to-ribbon/
Step 1 : First we have to create Reference and Strips in core database. Finally we have to create Chunks in the following file path : /sitecore/content/Applications/Content Editor/Ribbons/Chunks/
Step 2 : We have to create config file to initialize the command. We have to specify the CommandName and Type(Full class file name, namespace)
Step 3 : We have to create class file to write the logic for command what should happen when user clicked button from the ribbon.
Here, we are redirecting to external site by reading the url from link field of current item.
Path of the class file : Cirrus.Foundation.Sitecore.Commands.CustomPreviewButton
3. Created Custom Pipeline to Register Api routes
In the Initialize processor of pipeline, we need to register the api routes Cirrus.Service.SitecoreApi.RegisterApiRoutes.
Under service node, we have to register the Service type and the Implementation type which we invoked in the api.
4. Updated Existing Pipeline to Upload image in Azure blob
We are uploading the media items in azure blob, after user uploads image sitecore. We are storing the url value in CDN file path field in Sitecore.
Step 1 : First we have to create media item templates under our current site. It should inherit the standard sitecore media item template. The path of standard sitecore media item template : /sitecore/templates/System/Media/Unversioned/
We inherited one more base template _baseMediaExternalPath and it has the field CDN file path. It is used to store image url in azure blob. The reason for creating custom media template, each media item should have the CDN file path field.
Step 2 : Then we have to create config file to update existing pipeline. It will patch(run) the processor, after uploaded image has been saved in sitecore.
We have mentioned custom class file path, Name, Path (sitecore media library item) and list of templates, we want to update template of the new media items accordingly. It indicates, basically sitecore will create image item by using default media template. We are just overriding to update custom media template because the each media item should have CDN file path field. Also, our custom media template inherits sitecore default media template. Each templates has Old and New mapping.
Step 3 : We have to create class file to write the logic for upload image in Azure blob after the images has been saved in sitecore.
Path of the class file : Cirrus.Foundation.SitecoreExtensions.Processor.UploadToAzure
Step 4 : The media item should be like below,
,
5. Modified Existing Pipeline to prevent when user deleting the content item
This functionality implemented for, when user deleting the item, we are moving item to deletion workflow state instead of deleting the content item completely.
Alternatively we can say like "Remove the Delete access right from wherever you have defined it in your content tree."
For detailed reference, the below link covers
https://sitecore.stackexchange.com/questions/19262/adding-workflow-for-item-deletion
Step 1 : We need to create Deletion Approval workflow state. It contains the commands Approve for deletion and Reject. Approve command has the Delete action.
Step 2 : Then we have to create config file to update existing pipeline. It will patch(run) the processor, when user deleting content item in sitecore.
We have to specify type(Full class file name, AssemblyName), method(name of method).
Step 3 : We have to create class file to write the logic for updating Deletion Approval workflow state for the content item which user deleting.
Path of the class file : Cirrus.Foundation.Sitecore.Commands.Pipelines.CustomWorkflowDelete
In the Deletion Approved state, we have one action Delete item.
Step 5 : Delete item action will have reference of class file in Type string field. The value should be Full class file name, AssemblyName.
It will cover functionality of deleting item in sitecore.
Path of the class file : Cirrus.Foundation.Sitecore.Commands.Pipelines.DeleteApproved
6. Created Log4Net
The below node, used to create log4net in the config file.
<sitecore>
<log4net>
</log4net>
</sitecore>
7. Created Publishing Target
In Publishing Target, we need to create new Database first by creating config file. Then we have to create Publishing Target for the new database under the path /System/Publishing targets.
In that, we have to map the new database in the Target database field.
For detailed reference, the below link covers.
https://cmsview.wordpress.com/2015/03/17/sitecore-8-for-beginners-adding-custom-button-to-ribbon/
8. Helix principle learned from the project
Foundation Layer :
In Foundation layer, we can define Common, Helper, SitecoreCommands, SitecoreExtensions, Solr and Unit Testing.
Configuration Layer :
In Configuration layer, we can define environment specific access details like Azure storage account name, Azure storage account key, Azure storage container and Azure storage url.
Comments
Post a Comment