Posts

Showing posts with the label sitecore 7

Update item name using Sitecore Item Web API

Recently i have been using Sitecore Item Web API frequently to add/update/retrieve content from sitecore, Its easy to setup and use, and can save you time and effort when you integrate sitecore with other plateforms/systems Developers use the Sitecore Item Web API to manipulate the content items in Sitecore through HTTP requests. The API gives access to content through items paths, IDs, and Sitecore queries. This service produces output in JSON format and is both highly customizable and optimized to support a minimum number of requests. Sitecore Item Web API 1.0.0 Developer's Guide    I was asked a question recently on how to change Sitecore Item through the Item web API, and i thought that should simple and out of the box, right? Well, i was wrong, i could not find that its possible to update item name while going through Sitecore documentation: Updating Existing Items The HTTP PUT method is used to update existing items. This affects all items in the resolved s...

Set Workflow using Item Buckets Search Operations

Image
Recently one of our clients asked to set the workflow on large number of items that were created without workflow, so i was thinking of writing a script on powershell to do that, but then i thought why not extend Item buckets Search operation and add "Set Workflow" option there! Basically, You will need to write a command that sets the workflow for all items in search results, and register that command. 1- The Code: 2- The Configurations: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">   <sitecore>     <commands>       <command name="bucket:setworkflow" type="Sitecore.SharedSource.Buckets.SearchOperations.SetWorkflow, Sitecore.SharedSource.Buckets.SearchOperations"/>     </commands>   </sitecore> </configuration> 3- Adding Command item in Sitecore:  Open Content Editor and go to " /sitecore/system/Settings/Buckets/Settings/Search Operations/Fiel...

Adding custom properties to Social Connected users profile

Social Connected module gives the ability for website users to register through their social networks, like Facebook, Twitter, Linkedin and Google+, the module does a good job of mapping users data from these networks and add them to user profile in sitecore. Recently, we needed to add our own custom properties into users registered through Social networks, i was able to do this by using [social:connector:user:created] event. The following code grabs the user object from event parameters, and update the profile with our own custom property: namespace Sitecore.SharedSource.Events.Social {     public class UserCreated     {         protected void UpdateUserProfile(object sender,  EventArgs args)         {             var user = Sitecore.Events.Event.ExtractParameter(args, 0) as Sitecore.Security.Accounts.User;   ...