26 September 2015

Sitecore 8 setup a preview site

The out of the box capabilities of sitecore are quite large in terms of preview, experience editor... In most case scenario those are more than enough for content editor to preview their content before publishing the pages. However, from time to time it happens that part of approval process, a link to a person need to be sent so this person can view the page(s) and review it outside the workflow process. This can happen for Legal team to review any information on the page... well Obviously in those cases, it is quite tricky to set them up with a login details so they have to login into sitecore then preview the page.

What we could do in this situation is to setup a Preview site. Although this sounds great you will say that well since only item in the last step of the workflow can be published, this will not really work... Well here comes the power of publishing Target.

You will need to setup a new Publishing Target "Preview":



You can see that on the new Publishing target item you can tick the checkbox: "Preview publishing target". By ticking this checkbox you are allowing items that are not in final state to be published there. That is awesome...

Now, you will need to setup a new database and a new entry in the connection string config

  
  
  
  
  

  
  
  
  


When setting up the new database, you will also need to add the following configuration for the Preview Database:


  
    
      
      
        $(id)
        Images/database_web.png
        true
        
          
            publishing
            
              
              
            
          
        
        false
        
        
          
          
        
        
          100MB
          50MB
          2500KB
          50MB
          2500KB
        
      
    
  


You can also setup a few config to ensure that search index will also be created for your new Target DB. Create a new config file on your App_config/Include/XXX folder. Call the file: XXX.ContentSearch.Lucene.Index.Preview.config. Copy the following there:


  
    
      
        
          
            $(id)
            $(id)
            
            
            
            
              
              
            
            
              
                
              
            
            
              
                preview
                /sitecore
              
            
            

            
          
        
      
    
  



You can now define a new Site in your siteDefinition:


  
    
      
    
  


Finally ensure that you update the Sitecore.ContentSearch.DefaultConfigurations.config to add the new strategy:

          
            preview
            
            true
          


Now the final spte is to ensure that the users you are editing the content is in a role that has write permission on the Publishing target item. This will make sure that your editor will see the target in the publishing window. This will also make sure that he can check or uncheck this target.



Now on the workflow step you will now see that when the page is in the Awaiting for approval, you will still be able to publish it to the Preview site:


13 September 2015

Sitecore 8 and admin page to rebuild aggregation data

As sitecore devs, I am sure you are familiar with all the cool admin pages for clearing cache, viewing configuration file... Well since xDb I always wandered: all my analytics data goes into the mongo DB then Gets aggregatred but what if I need to trigger it manually? Well lucky sitecore thought about it. you have a nice page for that: /sitecore/admin/RebuildReportingDB.aspx.



Well if you start rebuilding straight away, you will encounter an error saying your reporting.secondary DB is not configured.

You can find more information about the secondray.reporting on the following links:

https://doc.sitecore.net/Sitecore%20Experience%20Platform/xDB%20configuration/Walkthrough%20Rebuilding%20the%20reporting%20database